fixing the error of input string not in the correct format